﻿//-----------------------------------------------------------------------
// <copyright file="InstallationProgressEventArgs.cs" author="Artak Mkrtchyan">
//     Creative Commons - GNU General Public License (http://creativecommons.org/licenses/GPL/2.0/
// </copyright>
// <author>Artak Mkrtchyan</author>
// <email>mkArtak@gmail.com</email>
// <date>20/03/2013</date>

using System;

namespace AppUpdateInstaller.Model
{
	public sealed class InstallationProgressEventArgs : EventArgs
	{
		private double percentComplete = 0;
		private IInstallationStage sender;
		private string status;

		public InstallationProgressEventArgs(IInstallationStage argSender, double argCompletenessPercentage, string argStatus = null)
		{
			if (argSender == null)
			{
				throw new ArgumentNullException("argSender");
			}

			if (argCompletenessPercentage < 0 || argCompletenessPercentage > 100)
			{
				throw new ArgumentOutOfRangeException("argCompletenessPercentage");
			}

			this.sender = argSender;
			this.percentComplete = argCompletenessPercentage;
			this.status = argStatus;
		}

		public double PercentComplete
		{
			get
			{
				return this.percentComplete;
			}
		}

		public string Status
		{
			get
			{
				return this.status;
			}
		}
	}
}
